home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog Special Freeware 31
/
FreelogHS31.iso
/
ArgentCompta
/
FASTCAISSE
/
Setup FASTCAISSE.exe
/
{app}
/
A Faire40.SQL
< prev
next >
Wrap
Text File
|
2003-10-08
|
2KB
|
92 lines
alter table artfour add condachat1 decimal(11,2) default 1;
update artfour set condachat1=condachat;
alter table artfour drop condachat;
alter table artfour alter condachat1 to condachat;
ALTER PROCEDURE "GET_NOM_CLIENT"
(
"INVALUE" INTEGER
)
RETURNS
(
"AVALUE" VARCHAR(85)
)
AS
DECLARE VARIABLE V1 VARCHAR(35);
DECLARE VARIABLE V2 VARCHAR(20);
BEGIN
SELECT C.DESIGNATION, T.PRENOM, T.NOM
FROM CLIENTS T
LEFT JOIN CHAINES C ON (C.TYPEC=7) AND (C.LIGNE=T.CIVILITE-1) AND (C.COLONNE=0)
WHERE T.INDX = :INVALUE
INTO :V1,:V2,AVALUE;
IF (:V2<>'') THEN
BEGIN
AVALUE = V2 || ' ' || AVALUE;
IF ((V1 IS NOT NULL) AND (V2 NOT STARTING WITH (V1 || ' '))) THEN AVALUE = V1 || ' ' || AVALUE;
END
ELSE IF (V1 IS NOT NULL) THEN AVALUE = V1 || ' ' || :AVALUE;
SUSPEND;
END
;
ALTER PROCEDURE "GET_NOM_FOUR"
(
"INVALUE" INTEGER
)
RETURNS
(
"AVALUE" VARCHAR(85)
)
AS
DECLARE VARIABLE V1 VARCHAR(15);
DECLARE VARIABLE V2 VARCHAR(20);
BEGIN
SELECT C.DESIGNATION, T.PRENOM, T.NOM
FROM FOURNISSEURS T
LEFT JOIN CHAINES C ON (C.TYPEC=7) AND (C.LIGNE=T.CIVILITE-1) AND (C.COLONNE=0)
WHERE T.INDX = :INVALUE
INTO :V1,:V2,AVALUE;
IF (:V2<>'') THEN
BEGIN
AVALUE = V2 || ' ' || AVALUE;
IF ((V1 IS NOT NULL) AND (V2 NOT STARTING WITH (V1 || ' '))) THEN AVALUE = V1 || ' ' || AVALUE;
END
ELSE IF (V1 IS NOT NULL) THEN AVALUE = V1 || ' ' || :AVALUE;
SUSPEND;
END
;
ALTER TABLE ARTICLES ADD LINKART INTEGER;
ALTER TABLE ARTICLES ADD LINKMACRO INTEGER;
CREATE PROCEDURE "ECLATE_RAYON"
(
"INDX" INTEGER
)
RETURNS
(
"R1" VARCHAR(40),
"R2" VARCHAR(40),
"R3" VARCHAR(40)
)
AS
DECLARE VARIABLE V1 VARCHAR(50);
DECLARE VARIABLE N1 SMALLINT;
DECLARE VARIABLE N2 SMALLINT;
DECLARE VARIABLE N3 SMALLINT;
BEGIN
SELECT RY1,RY2,RY3 FROM RAYONS WHERE PKEY = :INDX INTO :N1,:N2,:N3;
SELECT NOMRAYON FROM RAYONS WHERE (RY1=:N1) AND (RY2=0) AND (RY3=0) INTO :R1;
if (n2<>0) then SELECT NOMRAYON FROM RAYONS WHERE (RY1=:N1) AND (RY2=:N2) AND (RY3=0) INTO :R2;
if (n3<>0) then SELECT NOMRAYON FROM RAYONS WHERE (RY1=:N1) AND (RY2=:N2) AND (RY3=:N3) INTO :R3;
SUSPEND;
END
;
SET GENERATOR VERSION_BASE TO 40;
COMMIT;